<%@page import="java.util.List"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>


<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" href="wzxcss/roomSelect.css">
		<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>

		 <script  type="text/javascript" src = "js/jquery-2.0.3.js"></script>
		 	 <script  type="text/javascript" src = "js/bootstrap.js"></script>
		 	 
		 	 
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="wzxjs/roomSelect.js"></script>
<script src="wzxjs/bgfun.js"></script>
<script src="layui/layui.all.js"></script>
<script  type="text/javascript" src = "wzxjs/studyRoomManage.js"></script>

		<style type="text/css">
		 .onlinePeopleNum #onlinePeopleNum_1{
 				font-size:20px;
   				 color: gray;
  			}
		 .control-group{
 					padding:10px;
				}
		 .Fieldset{
		 			margin:20px auto;	
 					padding:20px;
				}
		input[type=text]{
		height:35px;
		}
		</style>
		 
</head>
<body >
	<%
			//if(session.getAttribute("accountName")==null){
			//response.sendRedirect("Login.jsp");
			//}
			%>



	
	<div class="container layui-container" >
			<div class="row clearfix layui-row">

			<div class="row clearfix">

				<div class="col-md-12 column">
					<nav class="navbar navbar-default" role="navigation">

						<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
							<div class="navbar-form navbar-left" role="search">
								<div class="form-group">
									<input type="text" class="form-control" id="searchContent"  name="searchContent"/><!-- 搜索框 -->
								</div> 
								<button type="submit" class="btn btn-default" onclick="searchStudyRoom()">搜索</button>
								<a  class="btn btn-default" data-toggle="modal"  href="#myModal_addStudyRoom">添加自习室</a>
							</div>
							
							<ul class="nav navbar-nav navbar-right">
							    <li>
							    <div class="onlinePeopleNum"><h1 id="onlinePeopleNum_1">在线人数为${count}</h1></div>
							    </li>
								<li>
									 <a href="#">返回</a>
								</li>
							</ul>
						</div>
						
					</nav>
					<table class="table table-striped table-bordered table-hover  layui-table"><!-- 自习室表格信息 -->
					<colgroup>
					    <col width="100">
                        <col width="250">
                        <col width="200">
                        <col width="200">
                        <col width="150">
                        <col width="150">
                        <col width="300">
                        <col width="300">
                        <col width="300">
                    </colgroup>
						<thead>
							<tr>
							<th >自习室编号</th>
							<th>位置</th>
                            <th>管理员</th>
                            <th>状态</th>
                            <th>座位总数</th>
                            <th>空座位数</th>
                             <th>开放时间</th>
                            <th>关闭时间</th>
                            <th>操作</th>
						</tr>
						</thead>
						   <tbody id="tbody1">
						   </tbody>
					</table>
					<div id="pagediv"></div>
					
	<!-- 添加自习室遮罩层 -->     
	<form id="myModal_addStudyRoom" class="modal fade" name="myModal"  onsubmit="return false" method="post" action="" style="display:none"> <!-- 遮罩层表单 -->
	         <div class="modal-dialog"  >
		       <div class="modal-content" >
			         <div class="modal-header" >   
                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">关闭</button>
                         <h4>添加自习室</h4> 
                     </div>
                      <div class="modal-body" >
                         <fieldset class="Fieldset">
                            <div class="control-group" >
                            <label class="control-label" for="studyRoomLocation">自习室编号:</label>
                            <input type="text"   name="studyRoomNo" id="study_Room_No_add" >
                            </div>
                            <div class="control-group"  >
                            	<label class="control-label" for="studyRoomLocation" >自习室位置:</label>
                   			    <div class="roomJilian" >
    										<div class="floorSelect" >
    										<input class="roomName layui-input"   style="width:150%" name="roomName" id="study_Room_Location_add" value="请选择">
      										</div>
											<div class="dropDown"  style="position: absolute; z-index: 10;">
														<div class="dropProv" >
     														<ul class="dropProvUl dropUl"></ul>
   										 			   </div>
    												   <div class="dropCity" >
													        <ul class="dropCityUl dropUl"></ul>
  													   </div>
     										</div>
       							  </div>
                            </div>
                  
                      
                            <div class="control-group"  >
                            <label class="control-label" for="studyRoomAdmin">管理员:</label>
                            <input type="text"   name="studyRoomAdmin" id="study_Room_Admin_add" >
                            </div>
                             <div class="control-group">
                             <label class="control-label" for=studyRoomStatus>自习室状态:</label>
                            <select name="studyRoomStatus"  id="study_Room_Status_add">
              								<option value="开放">开放</option>
            								<option value="关闭">关闭</option>
            				</select>
                            </div>
                            <div class="control-group">
                            	<label class="control-label" for="seatNum">座位总数:</label>
                            	<input type="text"  name="seatNum" id="seat_Num_add" >
                            </div>
                            <div class="control-group">
                            <label class="control-label" for="freeSeatNum">空座位数:</label>
                            <input type="text"  name="freeSeatNum" id="free_Seat_Num_add">
                            </div>
                            <div class="control-group">
                                  <label class="control-label" for="startTime">开放时间:</label>
                                  <input type="text"   name="StartTime" class="layui-input dateTime" placeholder="yyyy-MM-dd HH:mm:ss" id="test3" >
                            </div>
                            <div class="control-group">
                            <label class="control-label" for="endTime">关闭时间:</label>
                             <input type="text" name="EndTime" class="layui-input dateTime" placeholder="yyyy-MM-dd HH:mm:ss"   id="test4">
                            </div>
                            </fieldset>
                       </div>
                       <div class="modal-footer">
                            <input type="submit" id="add_Btn" class="btn btn-primary" value="确认" onclick="addStudyRoom()"  > <input type="button" class="btn" value="取消" data-dismiss="modal">
                            <input type="reset" name="reset" style="display:none">
                           <!-- 处理重复提交操作的一个 token 令牌，表单提交，令牌也提交 -->
							<%
							   //重复提交 I. 在session范围内产生一个token的值。
								session.setAttribute("token", System.nanoTime() + "");
							%>
							<!-- 重复提交 II 将token通过隐藏域传递给servlet -->
							<input type="hidden" name="token" value="${sessionScope.token}">
                       </div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</form>             

<!-- 修改自习室信息遮罩层 -->
     <form id="myModal" class="modal fade" name="myModal"  onsubmit="return false" method="post" action="" style="display:none"> <!-- 遮罩层表单 -->
	         <div class="modal-dialog">

<!-- 修改电影信息遮罩层 -->
     <form id="myModal" class="modal fade" name="myModal"  onsubmit="return false" method="post" action="" style="display:none;z-index: 10000"> <!-- 遮罩层表单 -->
	         <div class="modal-dialog" >

		       <div class="modal-content">
			         <div class="modal-header">   
                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">关闭</button>
                         <h4>修改自习室信息</h4> 
                     </div>
                      <div class="modal-body">
                                <fieldset class="Fieldset">
                            <div class="control-group" >
                            <input type="text"  name="studyRoomNo" id="study_Room_No_edit" style="display: none">
                            </div>
                            <div class="control-group">
                            <label class="control-label" for="studyRoomLocation">自习室位置:</label>
                   					 <div class="roomJilian" >
    										<div class="floorSelect" >
    											<input   class="roomName layui-input"  style="width:150%" name="roomName" id="study_Room_Location_edit" value="请选择">
      										</div>
											<div class="dropDown"  style="position: absolute; z-index: 10;">
														<div class="dropProv" >
     														<ul class="dropProvUl dropUl"></ul>
   										 			   </div>
    												   <div class="dropCity" >
													        <ul class="dropCityUl dropUl"></ul>
  													   </div>
     										</div>
       								 </div>
                           
                            </div>
                             <div class="control-group" >
                            <label class="control-label" for="studyRoomAdmin">管理员:</label>
                            <input   type="text"  name="studyRoomAdmin" id="study_Room_Admin_edit" >
                            </div>
                            <div class="control-group">
                             <label class="control-label" for=studyRoomStatus>自习室状态:</label>
                            <select name="studyRoomStatus"  id="study_Room_Status_edit">
              								<option value="开放">开放</option>
            								<option value="关闭">关闭</option>
            				</select>
                            </div>
                            <div class="control-group">
                            <label class="control-label" for="seatNum">座位总数:</label>
                            <input type="text"   name="seatNum" id="seat_Num_edit"  readonly="readonly">
                            </div>
                            <div class="control-group">
                            <label class="control-label" for="freeSeatNum">空座位数:</label>
                            <input type="text"   name="freeSeatNum" id="free_Seat_Num_edit" readonly="readonly">
                            </div>
                            <div class="control-group">
                                  <label class="control-label" for="startTime">开放时间:</label>
                                  <input type="text"  name="StartTime" class="layui-input dateTime" placeholder="yyyy-MM-dd HH:mm:ss" id="test1" >
                            </div>
                            <div class="control-group">
                            <label class="control-label" for="endTime">关闭时间:</label>
                             <input type="text" name="EndTime" class="layui-input dateTime" placeholder="yyyy-MM-dd HH:mm:ss"   id="test2">
                            </div>
                            </fieldset>
                       </div>
                       <div class="modal-footer">
                            <input type="submit" class="btn btn-primary" value="确认" onclick="editStudyRoom()"  data-dismiss="modal"> <input type="button" class="btn" value="取消" data-dismiss="modal">
                       </div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</form>                       
				</div>
			</div>




</body>
</html>